<template>
	<view>
		<!--开关组件-->
		<switch-button :result="result" @toFather="toFather"></switch-button>
		<!--外部控制-->
		<input type="button" value="change" @click="change">
		<text>{{ result }}</text>
	</view>
</template>

<script>
	import switchButton from '../../components/switch-button.vue'
	export default {
		data: {
			result: true //开关状态数据
		},
		methods: {
			change() {
				this.result = !this.result;
			},
			toFather(val) {
				this.result = val;
			}
		},
		components: {
			switchButton,
		},
	}
</script>
<style>
	view {
		display: block;
	}
</style>
